﻿using System;
using System.Web.Routing;

namespace Meotom.Upload.v2
{
    public class Global : System.Web.HttpApplication
    {

        protected void Application_Start(object sender, EventArgs e)
        {
            RegisterRoutes(RouteTable.Routes);
        }

        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }

        private static void RegisterRoutes(RouteCollection routes)
        {
            // Register a route for Categories/All
            // Route name
            // Route URL
            // Web page to handle route
            //routes.MapPageRoute("UserPage", "Users/{*action}", "~/Users.aspx")
            routes.MapPageRoute("HomePage", "Home", "~/Default.aspx");
            //routes.MapPageRoute("Intro", "Home/Khuyen-Mai", "~/KhuyenMai.aspx")
            //routes.MapPageRoute("Album", "Home/Albums", "~/Album.aspx")
            routes.MapPageRoute("Photo", "Home/Photos/{PhotoFrom}", "~/Redirected.aspx");
            routes.MapPageRoute("Contact", "Home/Contact", "~/Contact.aspx");
            routes.MapPageRoute("SendPassword", "Home/Account/SendPassword", "~/Account/SendPassword.aspx");

            // Route to handle Categories/{CategoryName}.
            // The {*CategoryName} instructs the route to match all content after the first slash, which is needed b/c some category names contain a slash, as in the category "Meat/Produce"
            // See http://forums.asp.net/p/1417546/3131024.aspx for more information
            // Route name
            // Route URL
            // Web page to handle route
            //routes.MapPageRoute("View Category", "Categories/{*CategoryName}", "~/CategoryProducts.aspx")

            // Register a route for Products/{ProductName}
            // Route name
            // Route URL
            // Web page to handle route
            //routes.MapPageRoute("View Product", "Products/{ProductName}", "~/ViewProduct.aspx")
        }
    }
}